package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class LoginController {

    @RequestMapping("/goLogin")
    public String login(HttpSession session, String userName, String password, Model model) {
        return "login";
    }

    @RequestMapping("/login")
    public String login2(String userName, String password, HttpSession session,Model model) {
        System.out.println(userName);
        session.setAttribute("userLoginInfo",userName);
        return "main";
    }

    @RequestMapping("/main")
    public String main(){
        return "main";
    }
}
